package com.leyou.order.controller;

import com.leyou.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
public class PayController {

    @Autowired
    private OrderService orderService;

    @PostMapping(value = "/pay/wx/notify", produces="application/xml")
    public Map<String, String> wxNotify(@RequestBody Map<String, String> paramMap){
        log.info("【微信支付回调通知处理器】开始执行！");
        Map<String, String> result = orderService.wxNotify(paramMap);
        log.info("【微信支付回调通知处理器】执行成功！");
        return result;
    }



}
